#include <iostream>
#include <vector>

using namespace std;

// 2016. 增量元素之间的最大差值
// https://leetcode.cn/problems/maximum-difference-between-increasing-elements/description/?envType=daily-question&envId=2025-06-16

class Solution
{
public:
    int maximumDifference(vector<int> &nums)
    {
        int ans = 0;
        int curMin = nums[0];
        for (int i = 1; i < nums.size(); i++)
        {
            if (nums[i] > curMin)
            {
                ans = max(nums[i] - curMin, ans);
            }else{
                curMin = nums[i];
            }
        }

        return ans > 0 ? ans : -1;
    }
};

int main()
{
    return 0;
}